1. Field of the Invention
This invention relates to the field of data processing, and, more particularly, to an improved video system providing a high resolution display for multiple virtual DOS (disk operating system) application programs. More specifically, the invention involves an improved video device driver for operating palette registers in a video subsystem without trapping foreground accesses to such registers.
2. Description of Related Art
IBM PS/2 personal computers are based on the 80xxx family of microprocessors that operate bimodally in real and protected modes. Such computers run under operating systems such as the well known IBM DOS (disk operating system) and IBM OS/2 operating systems. (IBM, PS/2 and OS/2 are trademarks of International Business Machines Corporation) DOS was originally developed to run early personal computers that used microprocessors operable in only a real mode. OS/2 was developed to take full advantage of the protected mode of operation of the microprocessors while maintaining compatibility with DOS application programs.
In PS/2 architecture, system video can be generated by a video graphics array (VGA) and associated circuitry, which drives a color display by analog signals. The VGA and display form part of a video subsystem that also includes a video buffer for storing the data to be displayed, and a video digital-to-analog converter (DAC). A description of the VGA appears in the "Video Subsystem (type 1)" section of the "IBM PERSONAL SYSTEM/2 HARDWARE INTERFACE TECHNICAL REFERENCE" manual, published by IBM 1988. The DAC includes a group of registers known as the video DAC palette registers. These palette registers store digital palette data for controlling the RGB (red, green, blue) output of the converter and hence the color of each pixel on the display. The registers are located at predetermined port addresses and have the following names: palette address (write mode) register, palette address (read mode) register, DAC state register, Palette data register, and PEL mask register.
The two palette address registers each store an 8-bit address or index into the palette data register. The palette data register holds 256-sets of triplet (three bytes) RGB data. In each byte of palette data, the upper two bits are disregarded and the least significant, lower 6-bits represent color data. The 6-bits of color data from each of the three bytes at a given index, are concatenated to form 18-bits of color data that controls the color of a pixel. During read and write operations, a palette address is written into the appropriate one of the palette address registers and successive accesses to the palette data register automatically increment the address register that was loaded.
Commercially available OS/2, version 2.0 provides a virtual video device driver that is active in a virtual DOS machine environment. The driver requires trapping of accesses to the palette data registers. Trapping code in the virtual video device driver tracks accesses to such registers and maintains a triplet counter that points to the current triplet member of the palette data. This trapping is necessary since a screen-switch could occur at any moment during the execution of an application. When an application is switched to the background, the counter is used to virtualize DAC accesses by keeping track of which triplet is being updated. This is also the case when an application is windowed. A windowed screen is an emulation of a full screen session. An application does not have direct access to the video I/O ports when the application is windowed. Thus, the virtual video device driver traps access to the hardware and emulates.